#ifndef _ACCEPTOR_H
#define _ACCEPTOR_H

#include "Socket.h"
#include "InetAddress.h"

class Acceptor {
public: 

    Acceptor(const string & ip, unsigned short port);

    ~Acceptor();

    void ready();

    int accept();

    int fd() const;
private: 
    Socket _sock;
    InetAddress _addr;

    void bind();

    void setReuseAddr();

    void setReusePort();

    void listen();
};

#endif 
